package com.TestDemo;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Random;

public class Test_Random {
    public static void main(String[] args) {
        //int
        System.out.println("RandomInt test 1 Start:");
        System.out.println((int)(Math.random()*80));
        System.out.println("Random testInt 1 OVER" + "\n" + "-------------");


        System.out.println("Random testInt 2 Start:");
        Random random = new Random();
        int i = random.nextInt(80);
        System.out.println(i);
        System.out.println("RandomInt test 2 OVER!" + "\n" + "---------------");
        Map<String, String> map = new HashMap();
        map.put("aaa","aaa");
        map.put("aaa","aaa1");
        map.put("aaa","aaa2");

        System.out.println(map.get("aaa"));

        //zifuchaung
        System.out.println("StringRandom TEST start: ");
        String str = "zifu:";

        str = str + (char)('A'+Math.random()*('Z'-'A' + 1));
        System.out.println(str);
        int len = 0;
        int count = 0;

        while ( len < 260){
            count = count +2;
            str = str + (char)('A'+Math.random()*('Z'-'A' + 1));

            if(len % 50 == 0&& count<260){

              int x = count - len;
              String s1 =   str.substring(x,count);

                System.out.println(s1);

            }

            len++;
        }
        System.out.println(str);
        System.out.println(str.length());
        System.out.println("String Test OVER! \n--------------");
    }
}
